home *** CD-ROM | disk | FTP | other *** search
Wrap
on stopMovie cleanup() resetCursor() storePrefs() end on replaceWellItem global gWellSprite sendSprite(gWellSprite, #mDropIt) end on replaceActiveBottle global gDraggingBottle, gLastIngredient, gSpoonSprite, gSoundFXchan, gMixingVesselsList gLastIngredient = 0 if inBonusMode() then playBonusSound(gSoundFXchan, "BRA_X04") end if sendSprite(gDraggingBottle, #mReplaceIt) sendSprite(gSpoonSprite, #mReplaceIt) repeat with X in gMixingVesselsList sendSprite(X, #mReplaceTop) end repeat end on rememberActiveBottle global gRememberIngredient, gRememberSprite, gDraggingBottle, gWellSprite, gSpoonSprite if draggingBottleThang() then gRememberIngredient = sprite(gDraggingBottle).pIngredient gRememberSprite = sprite(gDraggingBottle).pOrigSprite sprite(gDraggingBottle).visible = 0 else if draggingSpoon() then gRememberIngredient = #spoon gSpoonSprite.visible = 0 gRememberSprite = gSpoonSprite else if draggingWellThang() then gRememberIngredient = gWellSprite.pIngredient gWellSprite.visible = 0 gRememberSprite = gWellSprite else gRememberIngredient = VOID gRememberSprite = sprite(1) end if end if end if resetCursor() end on restoreActiveBottle global gRememberIngredient, gRememberSprite, gDraggingBottle, gSpoonSprite, gWellSprite gSpoonSprite.visible = 1 if voidp(gRememberIngredient) or not (draggingBottleOrSpoon() or (gWellSprite.memberNum <> 0)) then resetCursor() exit else if gRememberIngredient = #spoon then gSpoonSprite.visible = 1 hideCursor() else if draggingBottleThang() then sprite(gDraggingBottle).visible = 1 hideCursor() else if gRememberSprite = gWellSprite then gWellSprite.visible = 1 hideCursor() else if objectp(gRememberSprite) then gRememberSprite.visible = 1 resetCursor() end if end if end if end if end if end on onActorList thisActor return getOne(the actorList, thisActor) end on removeFromActorList thisActor findAt = onActorList(thisActor) if findAt then deleteAt(the actorList, findAt) end if end on addToActorList thisActor if inMenuMode() then exit end if findAt = onActorList(thisActor) if not findAt then add(the actorList, thisActor) end if end on findBigScripts maxK if voidp(maxK) then maxK = 10 end if repeat with X = 1 to the number of castLibs repeat with Y = 1 to the number of castMembers if member(Y, X).type = #script then len = length(member(Y, X).scriptText) if len > (1024 * maxK) then put member(Y, X) && member(Y, X).name && len end if end if end repeat end repeat put "done" end on findBigLists global gRecipes, gIngredients, gCharacterActions, gGlassware, gFlashRects, gImplementedCharacters, gMouthList put "gRecipes" && length(string(gRecipes)) put "gIngredients" && length(string(gIngredients)) put "gCharacterActions" && length(string(gCharacterActions)) put "gGlassware" && length(string(gGlassware)) put "gFlashRects" && length(string(gFlashRects)) put "gImplementedCharacters" && length(string(gImplementedCharacters)) put "gMouthList" && length(string(gMouthList)) end on getParentScripts repeat with X = 1 to the number of castLibs repeat with Y = 1 to the number of castMembers if member(Y, X).type = #script then if member(Y, X).scriptType = #parent then put "Parent script" && member(Y, X) end if end if end repeat end repeat end on findLinked repeat with X = 1 to the number of castLibs repeat with Y = 1 to the number of castMembers if (member(Y, X).fileName <> EMPTY) and (member(Y, X).type <> #flash) and (member(Y, X).type <> #sound) then put "Linked" && member(Y, X).type && member(Y, X).name && member(Y, X) && member(Y, X).fileName end if end repeat end repeat end on currentChar Active = getActiveCharacter() if Active then return sprite(Active).pCharCode else return VOID end if end on getCharActions charCode global gCharacterActions return gCharacterActions[charCode] end on currentActions if not voidp(currentChar()) then return getCharActions(currentChar()) else return [:] end if end on currentActionSteps global gCurrentIndex if count(currentActions()) then return currentActions()[gCurrentIndex][1] else return [:] end if end on currentActionName global gCurrentIndex if count(currentActions()) then return getPropAt(currentActions(), gCurrentIndex) else return "No Active Character" end if end on placeGlassOnBar dragSprite global gCharacterSprites, gBarTopManager, gBarSurface gBarSurface = 7 repeat with X in gCharacterSprites if sprite(X).member.type <> #flash then exit end if if hitTest(sprite(X), the clickLoc) = #normal then barSlot = SpriteToBarSlot(X) if barSpotIsFree(gBarTopManager, barSlot) then next repeat end if status = sprite(barSlotToSprite(barSlot)).pStatus if getBarTopGlass(gBarTopManager, barSlot) = #none then return [#closest: barSlot, #open: 1, #empty: 1, #status: status] next repeat end if if X = barSlotToSprite(barSlot) then if mIsEmpty(barSlotToGlassSprite(gBarTopManager, barSlot)) then return [#closest: barSlot, #open: 0, #empty: 1, #status: status] else carded = sprite(barSlotToSprite(barSlot)).pAlreadyCarded return [#closest: barSlot, #open: 0, #empty: 0, #status: status, #carded: carded] end if next repeat end if alertBeep() return [#closest: barSlot, #open: 0, #empty: 1] end if end repeat locH = dragSprite.locH barSlot = getClosestOpenSpot(gBarTopManager, locH)[#closest] if sprite dragSprite intersects gBarSurface or ((dragSprite.bottom < sprite(gBarSurface).bottom) and (dragSprite.bottom > (sprite(gBarSurface).top - 10))) then if getBarTopGlass(gBarTopManager, barSlot) = #none then return [#closest: barSlot, #open: 1, #empty: 1] else if mIsEmpty(barSlotToGlassSprite(gBarTopManager, barSlot)) then return [#closest: barSlot, #open: 0, #empty: 1] else alertBeep() return [#closest: barSlot, #open: 0, #empty: 0] end if end if else alertBeep() return [#closest: 0, #open: 0, #empty: 1] end if end on idle global gSoundTrack, gMusicChan if voidp(gSoundTrack) then stopMusic() else if soundBusy(gMusicChan) then else if audibleChannel(gMusicChan) then playTrack() end if end if end if end on prepareMovie global debug, gCharPlayList, gFileSep, gBonusPath, gManagerPath, gNoChaos, gHelpPointer, gObeyHelpPointerstate, gFloatSprite, gWellSprite, gToolTip, gDrinkContentSpr, gPourableItemsList, gBarGlassSprites, gPointerSprite, gBarTopSprite, gCharacterSprites, gQuality, gMixingVesselsList, gXbottlePopup, gSodaGunPopup, gSodaGun, gSodaText, gJukeHilight, gDoneFlash, gFastPlay, gDragRect, gSpoonSprite, gBonusCharacters, gOldRecipes, gOldIngredients, gOldCharActions, gOldCharInfo, gOldUserTips, gOldFlashRects, gOldGlassware, gOldGameLevels, gThrottleRate, gPourThrottleRate, gEvenPouring, gShowFlashRects, gRatingBoard, gEasyHeaven, gIceSounds, gReportDrink, gIceSprite, gArbusSprite, gSoundDevice, gQuickPlayMode, gMachineSpeed, gOldSoundLevel, gJukeMuteButton, gJukeVolumeSlider, gClickToIDorOrder, gIDbutton, gOrderButton, gServeButton, gEmptyButton, gGlassAndBeerList, gGlassList, gVesselList, gLemonLimeList, gCarbonatedList, gExcludeBonusList, gStartRegisterSpr, gEndRegisterSpr, gDecimalPoint, gMaxTips, gPearlyGates, gSoundExtension, gDemoVersion set the floatPrecision to 2 if onPC() then if voidp(gSoundDevice) then if the soundDevice = "MacroMix" then the soundDevice = "QT3Mix" end if end if end if set the exitLock to 1 setVis(1) oldClickToIDorOrder = gClickToIDorOrder oldQuickPlayMode = gQuickPlayMode oldMachineSpeed = gMachineSpeed oldRatingBoard = gRatingBoard oldDebug = debug oldChaos = gNoChaos oldQuality = gQuality oldFlash = gDoneFlash oldFastPlay = gFastPlay oldThrottle = gThrottleRate oldPourRate = gPourThrottleRate oldEvenPour = gEvenPouring oldShowFlashRects = gShowFlashRects oldRecipes = gOldRecipes oldngredients = gOldIngredients oldUserTips = gOldUserTips oldCharActions = gOldCharActions oldCharInfo = gOldCharInfo oldFlashRects = gOldFlashRects oldGlassware = gOldGlassware oldGameLevels = gOldGameLevels oldEasyHeaven = gEasyHeaven oldIceSounds = gIceSounds oldReportDrink = gReportDrink if (authoring() or debug) and voidp(gCharPlayList) then end if oldPlayList = gCharPlayList if authoring() then if not gPearlyGates then end if if the moviePath = "Zach Mac:Clients:bartend/Cutler:Cutler working:" then setbruce() end if end if gDemoVersion = 1 if gDemoVersion then gSoundExtension = ".swa" else gSoundExtension = ".aif" end if gMaxTips = 100000 gGlassAndBeerList = [#hiball, #shot, #collins, #old_fashioned, #cocktail, #beer] gGlassList = [#hiball, #shot, #collins, #old_fashioned, #cocktail] gVesselList = [#mixingGlass, #blender, #shaker] gLemonLimeList = [#lemonWedge, #limeWedge, #lemontwist, #limetwist] gCarbonatedList = [#cola, #gingerAle, #lemonLime, #Soda, #tonic] gExcludeBonusList = [#lemontwist, #limetwist, #lemon, #lime] gStartRegisterSpr = 100 gDecimalPoint = 103 gEndRegisterSpr = 105 gBarGlassSprites = [79, 83, 87] gMixingVesselsList = [49, 51, 53] startMainBarMode(#game) gCharacterSprites = [9, 13, 17] gBonusCharacters = [9, 11, 13] gBarTopSprite = sprite(7) gArbusSprite = sprite(23) gSodaGun = sprite(40) gIceSprite = sprite(42) gSpoonSprite = sprite(55) gIDbutton = sprite(92) gOrderButton = sprite(98) gServeButton = sprite(99) gEmptyButton = sprite(107) gPointerSprite = sprite(110) gFloatSprite = sprite(111) gWellSprite = sprite(113) gToolTip = sprite(114) gDrinkContentSpr = sprite(117) gJukeMuteButton = sprite(121) gJukeVolumeSlider = sprite(124) gJukeHilight = sprite(125) gSodaText = sprite(129) gXbottlePopup = sprite(142) gDragRect = sprite(147) gSodaGunPopup = sprite(143) gOldRecipes = oldRecipes gOldIngredients = oldngredients gOldUserTips = oldUserTips gOldCharActions = oldCharActions gOldCharInfo = oldCharInfo gOldFlashRects = oldFlashRects gOldGlassware = oldGlassware gOldGameLevels = oldGameLevels gThrottleRate = oldThrottle gPourThrottleRate = oldPourRate gEvenPouring = oldEvenPour gShowFlashRects = oldShowFlashRects gRatingBoard = oldRatingBoard gQuickPlayMode = oldQuickPlayMode gMachineSpeed = oldMachineSpeed gClickToIDorOrder = oldClickToIDorOrder if not integer(gThrottleRate) then gThrottleRate = 5 end if gThrottleRate = max(1, gThrottleRate) if not integerp(gPourThrottleRate) then gPourThrottleRate = 5 end if gPourThrottleRate = max(1, gPourThrottleRate) gEvenPouring = 1 gOldSoundLevel = rememberOriginalVolume() setDefaults() setOptionDefaults() debug = oldDebug gNoChaos = oldChaos gQuality = oldQuality gDoneFlash = oldFlash gCharPlayList = oldPlayList gFastPlay = oldFastPlay gEasyHeaven = oldEasyHeaven gIceSounds = oldIceSounds gReportDrink = oldReportDrink setUpPrefsFolder() readPrefs() gBonusPath = basePath() & "BONUSVO" & gFileSep gManagerPath = basePath() & "HP_VO" & gFileSep & "HPD_" if voidp(gQuality) then gQuality = #low end if if ilk(gQuality) <> #symbol then gQuality = symbol(gQuality) end if initCharInfo() initCharActions() InitCharacterMouths() initRecipes() initIngredients() initUserTips() correctUserTips() initGlassware() initFlashRects() menuMode(1) end on setGameSchedule fast global gGameSetup initGameLevels() repeat with thisLevel in gGameSetup if fast then thisLevel[#MINTIPS] = thisLevel[#MINTIPS] / 5 thisLevel[#duration] = thisLevel[#duration] / 4 thisLevel[#MAXEARLYTIPS] = thisLevel[#MAXEARLYTIPS] / 5 end if end repeat end on setOptionDefaults global gHelpPointer, gTwistTips, gGameTips, gSodaTips, gXbottleTips, gMuteAllSounds, gObeyHelpPointerstate, gMusicChan, gOldSoundLevel, gMuted defaultVolume = 255 repeat with chan = 1 to 8 set the volume of sound chan to fixVolume(defaultVolume) end repeat set the volume of sound gMusicChan to fixVolume(defaultVolume * 0.59999999999999998) restoreOriginalVolume(gOldSoundLevel) gHelpPointer = 1 gObeyHelpPointerstate = 1 gUseManagerVO = 1 gGameTips = 1 gSodaTips = 1 gTwistTips = 1 gXbottleTips = 1 resetXbottleFlags() resetSodaFlags() gMuteAllSounds = 0 gMuted = 0 end on readCharacterDatabase charCode global gTable charData = [:] mSetCriteria(gTable, "character_code", "=", string(charCode)) mOrderBy(gTable, "action_names") mSelect(gTable) numRecs = mSelectCount(gTable) mGoFirst(gTable) repeat with n = 1 to numRecs action = symbol(mGetField(gTable, "action_names")) steps = value(mGetField(gTable, "List")) weight = integer(mGetField(gTable, "weighting")) addProp(charData, action, [steps, weight]) mGoNext(gTable) end repeat return charData end on newCharacterEnters setAsActive, newChar, openSeat global gBarTopManager, gCharPlayList, gBounceInProgress, gPauseState, gImplementedCharacters, gCharacterSprites, gMachineSpeed, debug, gPearlyGates, gUserQuitFlag afterHours = 0 if gUserQuitFlag then return 0 end if if gPearlyGates then if newChar = #BC then afterHours = 1 else return 0 end if end if if not afterHours then if beyondMaxTips() or (timeLeftOnThisLevel() <= 0) then return 0 end if if gBounceInProgress or gPauseState or inMenuMode() then if not inTestMode() then return 0 end if end if if gMachineSpeed <> #fast then repeat with X in gCharacterSprites if sendSprite(X, #deferAction) then if debug then put "Deferred approaching patron on slow machine because others were animating" end if return 0 end if end repeat end if if voidp(setAsActive) and (numberAtBar(gBarTopManager) > 0) then return 0 end if if inRecipeMode() then if numberAtBar(gBarTopManager) > 0 then return 0 end if openSeat = 2 end if if maxAtBar(gBarTopManager) and not inTestMode() then return 0 end if end if resetNewCharacterTimer() if findNExtOccupiedSlot(gBarTopManager) = 0 then setAsActive = #Always end if if listp(gCharPlayList) and not inTestMode() then newChar = gCharPlayList[1][#char] if not inRecipeMode() then openSeat = gCharPlayList[1][#pos] end if deleteAt(gCharPlayList, 1) if count(gCharPlayList) = 0 then gCharPlayList = VOID end if setCustomPositionInfo(openSeat, newChar) else if voidp(openSeat) then openSeat = getOpenBarSeat(gBarTopManager) end if if inTestMode() and (openSeat <> 0) and not voidp(newChar) then setCustomPositionInfo(openSeat, newChar) end if if voidp(newChar) and (openSeat <> 0) then newChar = getRandomCharacter(gBarTopManager, openSeat) if voidp(newChar) then if numberAtBar(gBarTopManager) = 0 then newChar = randomFromList([#JS, #KY, #LG, #EM, #TF, #AT, #RN, #XF, #LN]) put "We're really desperate and something is very wrong. Let's bring on anyone" &&(newChar) else put "No character brought on due to excessive conflicts" return 0 end if end if end if end if if openSeat = 0 then put "No more room at the bar" return 0 else if voidp(newChar) then debugAlert("There should never be a void character added" && openSeat) return 0 end if setBarTopCharacter(gBarTopManager, openSeat, newChar) sendSprite(sprite(barSlotToSprite(openSeat)), #approach, newChar) case setAsActive of #Always, 1: setAsActive = 1 #ifServed: patronWithFocus = getActiveCharacter() if patronWithFocus = 0 then setAsActive = 1 else if sendSprite(patronWithFocus, #statusIs, [#offStage, #served, #retreating, #bouncing]) then setAsActive = 1 else setAsActive = 0 end if end if VOID: setAsActive = 0 otherwise: setAsActive = 0 end case end if if setAsActive then makePatronActive(openSeat) end if return 1 end on setCustomPositionInfo openSeat, newChar global gImplementedCharacters, gBarTopManager case openSeat of 1: customPosCheck = #P1A 2: customPosCheck = #P2A 3: customPosCheck = #P3A end case chosenCharInfo = gImplementedCharacters[newChar] if chosenCharInfo[customPosCheck] = 1 then posOffset = 0 else posOffset = chosenCharInfo[customPosCheck] end if setBarPositionOffset(gBarTopManager, openSeat, posOffset) end on flashMember charCode X = member(charCode & ".SWF") return X end on flashMouthMember charCode X = member(charCode & "_mouth") return X end on relinkExtraCast charCode charString = string(charCode) castLib("extrachr").fileName = setCharPath(charCode) & charString & "_extra.cst" end on setbruce global gBrucePath gBrucePath = "BetaBuild10:stuff:" end on resetCharDatabase resetCharInfo() resetCharActions() resetFlashRects() end on resetRecipeDatabase resetUserTips() resetGlassware() resetIngredients() resetRecipes() end on resetCharInfo global gOldCharInfo gOldCharInfo = 0 initCharInfo() cleanupcharInfo() put "CharInfo" && count(getOldCharInfoDB()) end on resetCharActions global gOldCharActions, gImplementedCharacters if count(gImplementedCharacters) < 1 then resetCharInfo() end if gOldCharActions = 0 initCharActions() cleanupCharActions() put "CharActions" && count(getOldCharActionsDB()) end on resetFlashRects global gOldFlashRects gOldFlashRects = 0 initFlashRects() cleanupFlashRects() put "FlashRects" && count(getOldFlashRectsDB()) end on resetIngredients global gOldIngredients member("ingredientDB").scriptText = EMPTY alert("Don't forget to replace '<void>' with 'void' in the ingredientDB script") gOldIngredients = 0 initIngredients() cleanupIngredients() put "Ingredients" && count(getOldIngredientsDB()) end on resetUserTips global gOldUserTips gOldUserTips = 0 initUserTips() cleanupUserTips() put "UserTips" && count(getOldUserTipsDB()) end on resetRecipes global gOldRecipes gOldRecipes = 0 initRecipes() put "Done importing. Now we still need to store them..." cleanUpRecipes() put "Recipes" && count(getOldRecipesDB()) end on resetGlassware global gOldGlassware gOldGlassware = 0 initGlassware() cleanupGlassware() put "Glassware" && count(getOldGlasswareDB()) end on resetgamelevels global gOldGameLevels gOldGameLevels = 0 initGameLevels() cleanupGameLevels() put "GameLevels" && count(getOldGameLevelsDB()) end on basePath global gBrucePath if voidp(gBrucePath) then return the moviePath else return gBrucePath end if end on setVOPath charCode global gFileSep, gCharInfo charString = string(charCode) voBaseLoc = setCharPath(charCode) & "VO" & gFileSep & charString return voBaseLoc end on setCharPath charCode global gFileSep charString = string(charCode) voBaseLoc = basePath() & "Chars" & gFileSep & charString & gFileSep return voBaseLoc end on VOpath charCode, VOname global gCharChildren, gSoundExtension voLoc = gCharChildren[charCode].pVOpath & "D_" & VOname & gSoundExtension return voLoc end on gotoRoundSummary beginPause() menuMode(1) dismissAllCrap() go("Summary") end on gotoBonusRound beginPause() menuMode(1) dismissAllCrap(0) returnToBar(#bonus) end on playBonusSoundDrop global gSoundFXchan playBonusSound(gSoundFXchan, "BRA_X05") end on dropWellItemInBonusRound pIngredient global gWellSprite garnishableList = [9, 11, 13, gWellSprite] repeat with X in garnishableList if not voidp(mapStageToMember(sprite(X), the clickLoc)) then playBonusSoundDrop() return sendSprite(X, #mDropIngredient, pIngredient) end if end repeat return 0 end on playBonusSound chan, soundName global gBonusPath, gSoundExtension if not audibleChannel(chan) then exit end if if voidp(soundName) or (chan < 1) then debugAlert("Bad bonus sound FX" && chan && soundName) exit end if if the number of member soundName > 0 then puppetSound(chan, soundName) else soundPlayfile(chan, gBonusPath & soundName & gSoundExtension) end if end on startMovie global gStageCorner, gCurrentSong, gBarTopManager, gDoneFlash, gGameLevel, gPlayerTips, gNameChosen, gSecretBottles bringAppToFront() if FileExists(gSecretBottles) and not authoring() then castLib("bottles_main").fileName = gSecretBottles end if the netThrottleTicks = 2000 the actorList = [] set the mouseDownScript to "resetFocusMouseDown" set the mouseUpScript to "resetFocusMouseUp" checkInstallation("MUI") retrieveHiScores() the randomSeed = the ticks setLevelCurrentSong() gNameChosen = 0 playTrack() resetNewCharacterTimer() setWindowDefaults() forgetAllWindows() setWindowDefaults() gStageCorner = point((the stage).rect.left, (the stage).rect.top) gGameLevel = 0 end